package aapilast3;

import java.util.Scanner;

public class ReflectDemo1 {
    public static void main(String[] args) throws ClassNotFoundException {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个类名:");
        String name = sc.nextLine();
        Class<?> cls = Class.forName(name);

        String className = cls.getName();
        System.out.println(className);
        className = cls.getSimpleName();
        System.out.println(className);

        Package pkg = cls.getPackage();
        String pkgName = pkg.getName();
        System.out.println("包名:"+pkgName);
    }
}
